/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.comfacauca.xmlc2.entidades.glpi;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author eorozco
 */
@Entity
@Table(name = "glpi_tickets_users")
@NamedQueries({
    @NamedQuery(name = "GlpiTicketsUsers.findAll", query = "SELECT g FROM GlpiTicketsUsers g"),
    @NamedQuery(name = "GlpiTicketsUsers.findById", query = "SELECT g FROM GlpiTicketsUsers g WHERE g.id = :id"),
    @NamedQuery(name = "GlpiTicketsUsers.findByTicketsId", query = "SELECT g FROM GlpiTicketsUsers g WHERE g.ticketsId = :ticketsId"),
    @NamedQuery(name = "GlpiTicketsUsers.findByUsersId", query = "SELECT g FROM GlpiTicketsUsers g WHERE g.usersId = :usersId"),
    @NamedQuery(name = "GlpiTicketsUsers.findByType", query = "SELECT g FROM GlpiTicketsUsers g WHERE g.type = :type"),
    @NamedQuery(name = "GlpiTicketsUsers.findByUseNotification", query = "SELECT g FROM GlpiTicketsUsers g WHERE g.useNotification = :useNotification"),
    @NamedQuery(name = "GlpiTicketsUsers.findByAlternativeEmail", query = "SELECT g FROM GlpiTicketsUsers g WHERE g.alternativeEmail = :alternativeEmail")})
public class GlpiTicketsUsers implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @NotNull
    @Column(name = "tickets_id")
    private int ticketsId;
    @Basic(optional = false)
    @NotNull
    @Column(name = "users_id")
    private int usersId;
    @Basic(optional = false)
    @NotNull
    @Column(name = "type")
    private int type;
    @Basic(optional = false)
    @NotNull
    @Column(name = "use_notification")
    private boolean useNotification;
    @Size(max = 255)
    @Column(name = "alternative_email")
    private String alternativeEmail;

    public GlpiTicketsUsers() {
    }

    public GlpiTicketsUsers(Integer id) {
        this.id = id;
    }

    public GlpiTicketsUsers(Integer id, int ticketsId, int usersId, int type, boolean useNotification) {
        this.id = id;
        this.ticketsId = ticketsId;
        this.usersId = usersId;
        this.type = type;
        this.useNotification = useNotification;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public int getTicketsId() {
        return ticketsId;
    }

    public void setTicketsId(int ticketsId) {
        this.ticketsId = ticketsId;
    }

    public int getUsersId() {
        return usersId;
    }

    public void setUsersId(int usersId) {
        this.usersId = usersId;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public boolean getUseNotification() {
        return useNotification;
    }

    public void setUseNotification(boolean useNotification) {
        this.useNotification = useNotification;
    }

    public String getAlternativeEmail() {
        return alternativeEmail;
    }

    public void setAlternativeEmail(String alternativeEmail) {
        this.alternativeEmail = alternativeEmail;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof GlpiTicketsUsers)) {
            return false;
        }
        GlpiTicketsUsers other = (GlpiTicketsUsers) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.comfacauca.xmlc2.entidades.glpi.GlpiTicketsUsers[ id=" + id + " ]";
    }
    
}
